package org.liziyi.pss.model.queue;

import org.liziyi.pss.entity.ProcessControlBlock;

import javax.swing.*;
import javax.swing.table.TableModel;

/**
 * 完成队列
 *
 * @author liziyi
 */
public class FinishQueue extends AbstractScheduleQueue{
    public FinishQueue(TableModel model){
        super(model);
    }

    @Override
    public synchronized void add(ProcessControlBlock pcb) {
        queueList.add(pcb);
        SwingUtilities.invokeLater(()->{
            queueTableModel.addRow(new Object[]{pcb.getPid(),pcb.getAttribute()});
        });
    }
}
